package com.chushouya.common.constant;

import com.general.framework.core.enums.IEnum;

/**
 * 商品推荐类型
 */
public enum GoodsRecommendEnum implements IEnum<Integer> {
    All(0, "全部"),
    Quality(1, "精品"),
    New(2, "新品"),
    Hot(3, "热销");

    private final Integer value;
    private final String desc;

    GoodsRecommendEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer value() {
        return value;
    }

    @Override
    public String named() {
        return desc;
    }

    public static String getDesc(Integer value) {
        if (value == null) {
            return null;
        }
        for (GoodsRecommendEnum type : values()) {
            if (value.equals(type.value)) {
                return type.desc;
            }
        }
        return "";
    }
}
